/**
 * 
 */
package com.oron3.bouncer;

/**
 * @author Ofek
 *
 */
public class Timer {

	private long time;
	/**
	 * 
	 */
	public Timer() {
		time = System.currentTimeMillis();
	}
	/**
	 * 
	 */
	public void restart() {
		time = System.currentTimeMillis();
	}

	/**
	 * @return
	 */
	public long elapsed() {
		return  System.currentTimeMillis() - time;
	}
	public boolean hasElapsed(final long time) {
		return  System.currentTimeMillis() - this.time >= time;
	}

	/**
	 * @return
	 */
	public float elapsedSec() {
		return (float) (elapsed()/1000.0);
	}

}
